Hydraulic cylinders are often integrated into heavy equipment such as backhoes and excavators to provide force for controlling, for example, the linkages and components of the heavy equipment. Typically, a piston may be enclosed within the hydraulic cylinder, and the piston may be connected to a piston rod that travels reciprocally within the hydraulic cylinder. Hydraulic fluid within the cylinder may act on the piston to cause the piston and a piston rod connected to the piston to control the heavy equipment's linkages and components. It is often desirable to determine the position of the piston within the hydraulic cylinder so as to determine the position of components coupled to the hydraulic cylinder. However, it can be difficult to determine the position of the piston due to the piston being sealed in the hydraulic cylinder.